
import React ,{Component} from 'react'

export default class Demo12__for extends Component {

  constructor(){
    super();
    this.state={
      dataList:[
        {name:'林庆虎'},{name:'林庆虎'},{name:'林庆虎'},{name:'林庆虎'},{name:'林庆虎'},{name:'林庆虎'}
      ]
    }
  }

  render(){
    return (
        <div>
          <h1>test for</h1>

          <ul>
            {
              this.state.dataList.map(
                  (value,index)=>
                <li id={index} key={index}>{value.name}</li>
              )
            }
          </ul>

        </div>
    );
  }

}